package com.sjc.counter.v1;

import com.sjc.counter.entity.RequestInfo;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.List;
import java.util.Map;

/**
 * @Classname RedisMetricsStorage
 * @Description 使用redis存储原始数据
 * @Date 2020/5/1 13:46
 * @Created by SangJiacun
 */
public class RedisMetricsStorage implements MetricsStorage{

    private RedisTemplate redisTemplate;

    @Override
    public void saveRequestInfo(RequestInfo requestInfo) {
        redisTemplate.opsForValue().set(requestInfo.getApiName(), requestInfo);
    }

    @Override
    public List<RequestInfo> getRequestInfos(String apiName, long startTimeInMillis, long endTimeInMillis) {
        return null;
    }

    @Override
    public Map<String, List<RequestInfo>> getRequestInfos(long startTimeInMillis, long endTimeInMillis) {
        return null;
    }
}
